'''
专项整治列表页面
'''
from Lib.base.keywords import KeyWords
from selenium.webdriver.common.by import By
from Lib.common.common_function import *
from Lib.base.page_object.login_page import LonginPage


class SpecialRectificationList(KeyWords):
    '''
    专项整治类
    '''
    url = KeyWords.url + 'special-rectification/list'

    def special_rectification_filter(self):
        '''
        专项整治筛选相关的功能测试
        :return:
        '''
        data = get_data_by_yaml(get_path() + r'\Data\element_data\special\special_list.yaml')
        element_operation(self, data[0]['data'])

    def special_rectification_search(self):
        '''
        查询功能
        :return:
        '''
        data = get_data_by_yaml(get_path() + r'\Data\element_data\special\search_special.yaml')
        element_operation(self, data[0]['data'])

    def special_rectification_collect(self):
        '''
        收藏专项整治
        :return:
        '''
        data = get_data_by_yaml(get_path() + r'\Data\element_data\special\collect_special.yaml')
        element_operation(self, data[0]['data'])

    def special_rectification_cancel_collect(self):
        '''
        取消收藏专项整治
        :return:
        '''
        data = get_data_by_yaml(get_path() + r'\Data\element_data\special\cancel_collect_special.yaml')
        element_operation(self, data[0]['data'])

    def special_detail_and_update(self):
        # 查看专项整治详情并编辑
        data = get_data_by_yaml(get_path() + r'\Data\element_data\special\special_detail_and_update.yaml')
        element_operation(self, data[0]['data'])

    def special_rectification_detail_flow(self):
        '''
        查看详情并流转
        :return:
        '''
        data = get_data_by_yaml(get_path() + r'\Data\element_data\special\special_detail_and_flow.yaml')
        element_operation(self, data[0]['data'])

    def special_rectification_add_work_log(self):
        '''
        添加工作日志
        :return:
        '''
        data = get_data_by_yaml(get_path() + r'\Data\element_data\special\special_work_log.yaml')
        element_operation(self, data[0]['data'])

    def delete_special_draft(self):
        '''
        删除草稿箱的内容
        :return:
        '''
        data = get_data_by_yaml(get_path() + r'\Data\element_data\special\delete_special_draft.yaml')
        element_operation(self, data[0]['data'])


if __name__ == '__main__':
    driver = choose_browser()
    L = LonginPage(driver)
    L.login('kobeAdmin002', 'kobe8888')
    case = SpecialRectificationList(driver)
    case.special_detail_and_update()
    driver.quit()
